/*     */ package eos.moe.dragoncore;
/*     */ import io.netty.buffer.ByteBuf;
/*     */ import java.io.ByteArrayOutputStream;
/*     */ import java.io.Closeable;
/*     */ import java.io.IOException;
/*     */ import java.nio.charset.StandardCharsets;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import java.util.UUID;
/*     */ import java.util.zip.GZIPOutputStream;
/*     */ import net.minecraft.nbt.NBTTagCompound;
/*     */ import net.minecraft.network.PacketBuffer;
/*     */ import net.minecraft.util.math.BlockPos;
/*     */ import net.minecraft.util.math.Vec3d;
/*     */ import net.minecraftforge.fml.common.network.NetworkRegistry;
/*     */ import net.minecraftforge.fml.relauncher.Side;
/*     */ 
/*     */ public class uy {
/*  22 */   public static SimpleNetworkWrapper g = NetworkRegistry.INSTANCE.newSimpleChannel("dragoncore:main");
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v() {
/*  27 */     g.registerMessage(rs.class, rs.class, 64, Side.SERVER);
/*  28 */     g.registerMessage(rs.class, rs.class, 64, Side.CLIENT);
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(HashMap a) {
/*  33 */     g.sendToServer(new rs(3, packetBuffer -> {
/*     */             packetBuffer.writeInt(a.size());
/*     */             for (Map.Entry entry : a.entrySet()) {
/*     */               packetBuffer.func_180714_a((String)entry.getKey());
/*     */               packetBuffer.func_180714_a((String)entry.getValue());
/*     */             } 
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void z(UUID a) {
/*  43 */     g.sendToServer(new rs(4, packetBuffer -> packetBuffer.func_179252_a(a)));
/*     */   }
/*     */   
/*     */   public static void v(UUID a) {
/*  47 */     g.sendToServer(new rs(11, packetBuffer -> packetBuffer.func_179252_a(a)));
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(String a, Set set) {
/*  57 */     g.sendToServer(new rs(5, packetBuffer -> {
/*     */             packetBuffer.func_180714_a(a);
/*     */             packetBuffer.writeInt(set.size());
/*     */             for (String str : set) {
/*     */               packetBuffer.func_180714_a(str);
/*     */             }
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(String a) {
/*  67 */     g.sendToServer(new rs(12, packetBuffer -> packetBuffer.func_180714_a(a)));
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(String a, String str1) {
/*  76 */     g.sendToServer(new rs(6, packetBuffer -> {
/*     */             packetBuffer.func_180714_a(a);
/*     */             packetBuffer.func_180714_a(str1);
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(int a, String str) {
/*  83 */     g.sendToServer(new rs(7, packetBuffer -> {
/*     */             packetBuffer.writeInt(a);
/*     */             packetBuffer.func_180714_a(str);
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(int a, int i, Vec3d vec3d) {
/*  90 */     g.sendToServer(new rs(9, packetBuffer -> {
/*     */             packetBuffer.writeInt(a);
/*     */             packetBuffer.writeInt(i);
/*     */             if (vec3d != null) {
/*     */               packetBuffer.writeFloat((float)vec3d.field_72450_a);
/*     */               packetBuffer.writeFloat((float)vec3d.field_72448_b);
/*     */               packetBuffer.writeFloat((float)vec3d.field_72449_c);
/*     */             } 
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(int a, int i) {
/* 102 */     g.sendToServer(new rs(10, packetBuffer -> {
/*     */             packetBuffer.writeInt(a);
/*     */             packetBuffer.writeInt(i);
/*     */           }));
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(String a, String... arrayOfString) {
/* 110 */     g.sendToServer(new rs(100, packetBuffer -> {
/*     */             packetBuffer.func_180714_a(a);
/*     */             packetBuffer.writeInt(arrayOfString.length);
/*     */             for (String str : arrayOfString) {
/*     */               packetBuffer.func_180714_a(str);
/*     */             }
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(BlockPos a) {
/* 120 */     g.sendToServer(new rs(1001, packetBuffer -> packetBuffer.writeLong(a.func_177986_g())));
/*     */   }
/*     */   
/*     */   public static void v(int a) {
/* 124 */     g.sendToServer(new rs(1002, packetBuffer -> packetBuffer.writeInt(a)));
/*     */   }
/*     */   
/*     */   public static void v(BlockPos a, NBTTagCompound nBTTagCompound) {
/* 128 */     g.sendToServer(new rs(1003, packetBuffer -> {
/*     */             packetBuffer.writeLong(a.func_177986_g());
/*     */             ur.v(nBTTagCompound, (ByteBuf)packetBuffer);
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(int a, NBTTagCompound nBTTagCompound) {
/* 135 */     g.sendToServer(new rs(1004, packetBuffer -> {
/*     */             packetBuffer.writeInt(a);
/*     */             ur.v(nBTTagCompound, (ByteBuf)packetBuffer);
/*     */           }));
/*     */   }
/*     */   
/*     */   public static void v(NBTTagCompound a) {
/* 142 */     g.sendToServer(new rs(1005, packetBuffer -> ur.v(a, (ByteBuf)packetBuffer)));
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public static void v(Map a) {
/* 148 */     StringBuilder stringBuilder = new StringBuilder();
/* 149 */     for (Map.Entry entry : a.entrySet()) {
/* 150 */       stringBuilder.append((String)entry.getKey()).append(",").append((String)entry.getValue()).append("|");
/*     */     }
/* 152 */     byte[] arrayOfByte = v(stringBuilder.toString().getBytes(StandardCharsets.UTF_8));
/* 153 */     if (arrayOfByte == null)
/*     */       return; 
/* 155 */     List<byte[]> list = v(arrayOfByte, 30000);
/*     */     
/* 157 */     if (list.size() == 0) {
/* 158 */       v(new byte[0], true);
/*     */     } else {
/* 160 */       for (int i = 0; i < list.size(); i++) {
/* 161 */         v(list.get(i), (i == list.size() - 1));
/*     */       }
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static List<byte[]> v(byte[] a, int i) {
/* 176 */     List<byte[]> list = new ArrayList();
/* 177 */     int j = 0;
/*     */     
/* 179 */     while (j < a.length) {
/* 180 */       int k = j;
/* 181 */       j = Math.min(j + i, a.length);
/* 182 */       byte[] arrayOfByte = Arrays.copyOfRange(a, k, j);
/* 183 */       list.add(arrayOfByte);
/*     */     } 
/* 185 */     return list;
/*     */   }
/*     */   
/*     */   public static byte[] v(byte[] a) {
/* 189 */     ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
/* 190 */     GZIPOutputStream gZIPOutputStream = null;
/*     */     try {
/* 192 */       gZIPOutputStream = new GZIPOutputStream(byteArrayOutputStream);
/* 193 */       gZIPOutputStream.write(a);
/* 194 */       gZIPOutputStream.close();
/* 195 */     } catch (IOException iOException) {
/* 196 */       iOException.printStackTrace();
/* 197 */       v(byteArrayOutputStream);
/* 198 */       v(gZIPOutputStream);
/* 199 */       return null;
/*     */     } finally {
/* 201 */       v(byteArrayOutputStream);
/* 202 */       v(gZIPOutputStream);
/*     */     } 
/* 204 */     return byteArrayOutputStream.toByteArray();
/*     */   }
/*     */   
/*     */   public static void v(Closeable a) {
/*     */     try {
/* 209 */       if (a != null) {
/* 210 */         a.close();
/*     */       }
/* 212 */     } catch (IOException iOException) {}
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncor\\uy.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */